package com.woniuxy.background.dao;

import com.woniuxy.background.pojo.Log;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

@Mapper
@Component
public interface LogMapper {
    int deleteByPrimaryKey(Integer logId);

    int insert(Log record);

    int insertSelective(Log record);

    Log selectByPrimaryKey(Integer logId);

    int updateByPrimaryKeySelective(Log record);

    int updateByPrimaryKey(Log record);

    @Delete("delete from log where create_time <= #{time}")
    int deleteLogByDate(Date time);

    List<Log> queryLogsByPage(@Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize, @Param("username") String username);

    void batchDeleteLog(List<Integer> list);
}